<template>
	<van-button
		v-bind="$attrs"
		class="app-mob-button"
		@click="handleClick"
		:type="type"
		:disabled="disabled"
		:round="shape == 'round'"
		:size="size"
		:loading="loading"
	>
		<template #icon v-if="hasSlot('icon')">
			<slot name="icon"></slot>
		</template>
		<slot></slot>
	</van-button>
</template>
		

<script lang="ts" setup>
import { buttonProps } from './button';
const name = 'AppButton';
const props = defineProps(buttonProps);
const emit = defineEmits(['click']);
const handleClick = (event: MouseEvent) => {
	emit('click', event);
};
const hasSlot = (name: string) => {
	return !!useSlots()[name];
};
</script>
